home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / boost4.arc / BOXSPEED.PAS < prev    next >
Pascal/Delphi Source File  |  1988-10-23  |  2KB  |  104 lines

  1. Program BoxSpeed;
  2.  
  3. { A benchmark of Boosters' BOX procedure.
  4.  
  5.   Box size    Time (sec)*
  6.   --------    ----------
  7.    2x2            5    (min box size)
  8.   40x25          13    (half-screen)
  9.   80x25          17    (max box size)
  10.  
  11.   *Times are averages using a stopwatch,
  12.    run on a Compaq portable with 8088 cpu }
  13.  
  14. Uses crt,BOSHARE;
  15. var
  16.    i : word;
  17.    c : char;
  18.    s,t : string;
  19.  
  20. { ------------------ }
  21. { Signal end of loop }
  22. { ------------------ }
  23. Procedure Speak;
  24. var
  25.    i,j : word;
  26. begin
  27.    for i := 1 to 84 do begin
  28.       sound(900+(i-1)*60);
  29.       delay(02);
  30.    end;
  31.    NoSound;
  32.    delay(100);
  33.    for i := 1 to 20 do begin
  34.       for j := 1 to 8 do begin
  35.          sound(6500-(j-1)*600);
  36.          delay(01);
  37.       end;
  38.       for j := 8 downto 1 do begin
  39.          sound(6500-(j-1)*600);
  40.          delay(01);
  41.       end;
  42.    end;
  43.    NoSound;
  44.    sound(25);
  45.    delay(400);
  46.    NoSound;
  47. end;
  48.  
  49. { ------------------------- }
  50. { Get a key, halt if ESCAPE }
  51. { ------------------------- }
  52. Procedure GetKey;
  53. begin
  54.    c := readkey;
  55.    if c = #27 then halt;
  56. end;
  57.  
  58. BEGIN
  59.  
  60.    s := 'Press a key to start';
  61.    t := ' DONE - press a key ';
  62.  
  63. {---  Min screen size  ---}
  64.    clrscr;
  65.    box (2,2,4,4,1,7);
  66.    ctrscr ('e',' 10,000 iterations ',40,1,1,14 );
  67.    ctrscr ('e',s,40,1,13,30 );
  68.    GetKey;
  69.  
  70.    for i := 1 to 10000 do
  71.       box ( 2,2,4,4,1,7 );
  72.  
  73.    ctrscr ( 'e', t,40,1,13,14 );
  74.    Speak;
  75.    GetKey;
  76.  
  77. {---  Half screen size  ---}
  78.    clrscr;
  79.    box (1,1,40,25,1,7);
  80.    ctrscr ('e',' 10,000 iterations ',40,1,1,14 );
  81.    ctrscr ('e',s,40,1,13,30 );
  82.    GetKey;
  83.  
  84.    for i := 1 to 10000 do
  85.       box ( 1,1,40,25,1,7 );
  86.  
  87.    ctrscr ( 'e', t,40,1,13,14 );
  88.    Speak;
  89.    GetKey;
  90.  
  91. {---  Max screen size  ---}
  92.    clrscr;
  93.    box (1,1,80,25,1,7);
  94.    ctrscr ('e',' 10,000 iterations ',80,1,1,14 );
  95.    ctrscr ('e',s,80,1,13,30 );
  96.    GetKey;
  97.  
  98.    for i := 1 to 10000 do
  99.       box ( 1,1,80,25,1,7 );
  100.  
  101.    ctrscr ( 'e', t,80,1,13,14 );
  102.    Speak;
  103.  
  104. END.